Skip to content

feat: add disableDefaultRules option to ModeConfig#11614

Draft
roomote[bot] wants to merge 2 commits intomainfrom
feature/disable-default-rules-mode-option
Draft

feat: add disableDefaultRules option to ModeConfig#11614
roomote[bot] wants to merge 2 commits intomainfrom
feature/disable-default-rules-mode-option

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Feb 19, 2026

This PR attempts to address Issue #11611. Feedback and guidance are welcome.

Summary

Adds a new optional disableDefaultRules boolean field to the ModeConfig schema. When set to true on a custom mode, only mode-specific rules (.roo/rules-{mode}/) are loaded. Default/generic rules (.roo/rules/, AGENTS.md, .roorules, .clinerules) are skipped.

Usage

In custom_modes.yaml:

customModes:
  - slug: my-focused-mode
    name: My Focused Mode
    roleDefinition: ...
    groups: [read]
    disableDefaultRules: true

Or via the UI toggle in the mode settings panel for custom modes.

Changes

  • packages/types/src/mode.ts: Added disableDefaultRules: z.boolean().optional() to modeConfigSchema
  • src/core/prompts/sections/custom-instructions.ts: Updated addCustomInstructions() to accept and respect the new flag -- when true, skips AGENTS.md and generic rules
  • src/core/prompts/system.ts: Threads modeConfig.disableDefaultRules into addCustomInstructions() options
  • webview-ui/src/components/modes/ModesView.tsx: Added a checkbox toggle for custom modes
  • webview-ui/src/i18n/locales/en/prompts.json: Added localization keys for the new toggle
  • Tests: Added schema validation tests and addCustomInstructions behavior tests

Benefits

  • Non-breaking: the field is optional and defaults to false (current behavior preserved)
  • Works with both custom_modes.yaml and .roomodes project-level configs
  • Mode-specific rules still load, giving focused modes exactly the rules they need
  • Reduces rule noise for specialized modes, improving model adherence

Closes #11611

Start a new Roo Code Cloud session on this branch

Adds a new optional `disableDefaultRules` boolean field to the ModeConfig
schema. When set to true on a custom mode, only mode-specific rules
(.roo/rules-{mode}/) are loaded -- generic/default rules (.roo/rules/,
AGENTS.md, .roorules, .clinerules) are skipped.

This addresses the need for focused modes that should not inherit the
default rule set, reducing rule noise and improving model adherence.

Changes:
- packages/types/src/mode.ts: Add disableDefaultRules to modeConfigSchema
- src/core/prompts/sections/custom-instructions.ts: Respect the flag
- src/core/prompts/system.ts: Thread the flag from mode config
- webview-ui: Add UI toggle for custom modes
- Tests: Schema validation and addCustomInstructions behavior

Closes #11611
@anderrom
Copy link

@roomote create translations required for check-translation ci

@roomote
Copy link
Contributor Author

roomote bot commented Feb 20, 2026

Fixaroo Clock   See task

Added disableDefaultRules translations (label + description) to all 17 non-en locale prompts.json files. Validated with find-missing-translations.js -- zero missing keys.

View commit | Revert commit

@roomote
Copy link
Contributor Author

roomote bot commented Feb 20, 2026

All translations for the disableDefaultRules keys are already present in every locale's prompts.json. The translation check script confirms no missing translations. CI checks are currently running on the latest push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Add mode argument that allows it to ignore default rules, only specific mode rules are loaded

2 participants

Comments